import os

import launch
import launch.actions
import launch.events

import launch_ros
import launch_ros.actions
import launch_ros.events

from launch import LaunchDescription
from launch_ros.actions import LifecycleNode
from launch_ros.actions import Node

import lifecycle_msgs.msg

from ament_index_python.packages import get_package_share_directory

def generate_launch_description():

    ld = launch.LaunchDescription()
    hybrid_a_star_debug_dir = launch.substitutions.LaunchConfiguration(
        'hybrid_a_star_debug_param_dir',
        default=os.path.join(
            get_package_share_directory('hybrid_a_star_debug'),
            'param',
            'replan_param.yaml'))

    replan_node = launch_ros.actions.Node(
        name='replan_node',
        namespace='',
        package='hybrid_a_star_debug',
        executable='hybrid_a_star_debug',
        parameters=[hybrid_a_star_debug_dir],
        output='screen')
    ld.add_action(replan_node)
    return ld
